<template>
  <div>
<MyHeader
title= " 2022秋冬季女装购物车"
bgc="pink"
/>
<div class="main">
  <MyGoods
  v-for="obj in list" :key="obj.id"
  :gObj="obj"
  >
  </MyGoods>
  </div>
<MyFooter :arr= 'list'/>

  </div>
</template>

<script>
import MyHeader from "./components/MyHeader.vue"
import MyGoods from "./components/MyGoods.vue"
import MyFooter from "./components/MyFooter.vue"

export default {
components:{
  MyHeader,
  MyGoods,
  MyFooter,
},
data(){
return {
  list:[] //所有商品的数据
}
},
created(){
  this.$axios({
    url:"/api/cart"
  }).then((res)=>{
    // console.log(res);
    this.list=res.data.list
   
    
    
  }).catch((error)=>{
    log.error(error);
  })
}
}
</script>

<style scoped>
.main{
  padding-top: 45px;
  padding-bottom: 51px;
}
</style>